package execution;

import gui.Gui;
import model.Calculator;
import model.EffortEstimation;
import model.Pharser;
import data.Project;

public class Main {
	public static double effort = 0;
	public static void main(String[] args) {

		Calculator ee = new EffortEstimation();

		if (args.length == 0) {
			Gui g = new Gui();
			g.setCalculator(ee);
		
		} else if (args.length == 1) {
			String fp = "src/testdata.txt";
			Pharser parse = new Pharser(fp);
			
			String[] values = args[0].split(",");
			Project p = new Project(values);
			
			
			effort = ee.calculate(p, parse.projects(),0.4);
			
			System.out.format("%f person months %n", effort/730.484398);
			
		} else {
			System.err.println("Wrong number of arguments");
			System.out.println("First parameter should be a list in the format: val1,val2,val3...");
		}
	}
	
}
